from pymysql import Connection

# 创建连接
conn = Connection(
    host='localhost',
    port=3306,
    user='root',
    password='success',
    autocommit=True  # 自动提交
)

cursor = conn.cursor()  # 获取游标对象
conn.select_db('student')

cursor.execute("insert into student values(88886, 'Jagochan', 11, '男')")

conn.commit()  # 手动提交

conn.close()
